package com.lsh.radardemo;

import android.os.Bundle;
import android.widget.TextView;
import android.widget.Button;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;

public class VehicleBatteryActivity extends AppCompatActivity {
    private TextView tvBatteryLevel, tvBatteryHealth, tvBatteryTemp;
    private Button btnRefresh, btnBack;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_vehicle_battery);

        tvBatteryLevel = findViewById(R.id.tv_battery_level);
        tvBatteryHealth = findViewById(R.id.tv_battery_health);
        tvBatteryTemp = findViewById(R.id.tv_battery_temp);
        btnRefresh = findViewById(R.id.btnRefresh);
        btnBack = findViewById(R.id.btnBack);

        btnRefresh.setOnClickListener(v -> refreshBatteryInfo());
        btnBack.setOnClickListener(v -> finish());

        refreshBatteryInfo();
    }

    private void refreshBatteryInfo() {
        // 假数据
        int batteryLevel = 85; // 百分比
        String batteryHealth = "良好";
        float batteryTemp = 32.5f; // 摄氏度

        tvBatteryLevel.setText("电池电量: " + batteryLevel + "%");
        tvBatteryHealth.setText("健康状态: " + batteryHealth);
        tvBatteryTemp.setText("温度: " + batteryTemp + "℃");
    }
} 